From: Marco Trevisan (TreviƱo) Date: Tue, 17 Feb 2026 14:12:59 +0000 (+0100) Subject: search: Do not use terms class variable after awaiting X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~26^2~1^2~49 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e89be4e9fc013b6971f89998f39754198fd5aa78;p=gnome-shell.git search: Do not use terms class variable after awaiting The terms may have been changed after awaiting, so rather than relying on the local variable, just pass the value to the functions using them Part-of: --- diff --git a/js/ui/search.js b/js/ui/search.js index b96ec635c..334f1243a 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -693,20 +693,21 @@ export const SearchResultsView = GObject.registerClass({ provider.searchInProgress = true; let results = []; + const terms = this._terms; try { if (this._isSubSearch && previousResults) { results = await provider.getSubsearchResultSet( previousResults, - this._terms, + terms, this._cancellable); } else { results = await provider.getInitialResultSet( - this._terms, + terms, this._cancellable); } } finally { this._results[provider.id] = results; - await this._updateResults(provider, results); + await this._updateResults(provider, terms, results); } } @@ -854,8 +855,7 @@ export const SearchResultsView = GObject.registerClass({ } } - async _updateResults(provider, results) { - const terms = this._terms; + async _updateResults(provider, terms, results) { const display = provider.display; try {